package com.qiandw.common

import org.apache.commons.codec.digest.DigestUtils

class StrExtUntil(str: String) {

  def isNullOrWhiteSpace: Boolean = {
    str == null || str.isEmpty || str.length() == 0 || str.replaceAll(" ", "") == ""
  }

  def sha1(salt: String = ""): String = {
    DigestUtils.sha1Hex(str + salt)
  }

  def md5(salt: String = ""): String = {
    DigestUtils.md5Hex(str + salt)
  }

}
